package com.study.b01threadpool;

import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class MyThreadPollDemo {
    public static void main(String[] args) throws InterruptedException {

        //获取线程池对象
        ExecutorService pool1= Executors.newFixedThreadPool(3);

        pool1.submit(new MyRunnable());


        pool1.submit(new MyRunnable());

        pool1.submit(new MyRunnable());

        pool1.submit(new MyRunnable());


        //销毁线程池
        //pool1.shutdown();
    }
}
